package com.example.controller;

import com.example.mapper.UserMapper;
import com.example.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {
    @Autowired
    UserMapper userMapper;
    @RequestMapping("/getUserList")
    public List<User> getUserList(){
        return userMapper.getUserList();
    }
    @RequestMapping("/getUserByName/{name}")
    public User queryUserByName(@PathVariable("name") String name){
        return userMapper.queryUserByName(name);
    }
}
